package com.cj.user.service.demo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @Author cheng jun
 * @Description:
 * @Date 2021/3/20 22:08
 */
public class Demo1 {

    public Demo1() {

    }

    public Demo1(int aaa) {
        System.out.println("父类");
    }


    public void demo1(int aaa) {
        int[] array = new int[]{1,2,3};
        int a = array.length;
        String str = "aaaa";
        boolean b = a < str.length();
        System.out.println("父类:" + aaa);
        String str2 = "aaaa";
        System.out.println("hashcode1:" + str.hashCode() + "---" + "hashcode2:" + str2.hashCode());
    }

    public void demo2() {
        int[] a = new int[]{1,2,3};
        int[] b = a;
        b[0] = 2;
        for (int i = 0;i < b.length;i++) {
            System.out.println(a[i]);
        }
        demo3(b);
    }

    public void demo3(int[] aaa) {
        int[] bbb = aaa;
        bbb[0] = 3;
        for (int i = 0;i < aaa.length;i++) {
            System.out.println(aaa[i]);
        }
        StringBuilder a = new StringBuilder();
    }

    //上下文
    public void demo4(HttpServletRequest request) {
        HttpSession httpSession = request.getSession();
        httpSession.getServletContext();
    }

    public static void main(String[] args) {
        Demo1 demo1 = new Demo1(123);
        demo1.demo2();
    }
}
